﻿using System;
using System.Linq;
using FVG.Entities.Properties;
using FVG.Entities.Repositories;

namespace FVG.Entities.ClientInformation.Repositories
{
	public class WebsiteRepository : ParentChildRepository<Website>, IWebsiteRepository
	{
		public WebsiteRepository() : base(Settings.Default.DbName, Settings.Default.MongoConnectionString)
		{
		}

		public IQueryable<Website> GetCustomerWebsites(Guid customerId)
		{
			using (var context = GetContext())
			{
				return context.Queryable<Website>(w => w.ParentId == customerId);
			}
		}
	}
}